<form action="/thirteenwins/admin/results/play" method="post">
Match id:<input type=text name=mid> - Result id:<input name=rid type=text> <%=submit_tag "PLAY"%> 
</form>

<h2><b>Next Match</b></h2>
<table>
  <tr><td>Match id</td><td>Home Team</td><td>Away Team</td><td>Begin at</td><td>Bets</td></tr>
<%Match.find(:all,:conditions=>["played = false"],:order =>"begin_at asc").each do |match|%>
  <tr><td><%=match.id%></td><td><%=match.home_team.name%>[<%=match.home_team.display_name%>]</td><td><%=match.away_team.name%>[<%=match.away_team.display_name%>]</td><td><%=match.begin_at.strftime("%Y-%m-%d %H:%M")%></td><td><%=match.bets.size%></td></tr>
<%end%>
</table>
<br/>
<br/>

<h1><b>Listing fetch results</b></h1>

<br/>
<br/>
<table>
  <tr>
    <th>RID</th>
    <th>Home team</th>
    <th width=10%>Away team</th>
    <th>Home point</th>
    <th>Away point</th>
    <th>Type</th>
    <th>fetch date</th>
    <th>Processed</th>
    <th colspan=2>admin</th>
  </tr>

<% for result in @results %>
  <tr>
    <td><%=h result.id%></td>
    <td><%=h result.home_team %></td>
    <td><%=h result.away_team %></td>
    <td><%=h result.home_point %></td>
    <td><%=h result.away_point %></td>
    <td><%=h result.rtype%></td>
    <td><%=h result.created_at.strftime("%Y-%m-%d %H:%M")%></td>
    <td><%=h result.processed %></td>
    <td><%= link_to 'Edit', edit_admin_result_path(result) %></td>
    <td><%= link_to 'Destroy', [:admin,result], :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
<% end %>
